<template>
  <div class="nodata" v-if="status!=2">
    <div v-if="status === 0">
      <img src="~/assets/images/nodata.png" class="icon" v-if="isPic"/>
      <div class="text cor999">{{ message }}</div>
    </div>
    <div v-if="status === 1">
      <div class="loading"><img src="~/assets/images/login.gif" class="loadingIcon">加载中...</div>
    </div>
    <div v-if="status === -1">
      <div class="noMore">
        <image src="/static/img/nomore.png" class="noMoreicon"></image>
        已到最底部，没有更多啦~
      </div>
    </div>
  </div>
</template>

<script>
// status 0没有数据 1继续加载 2不显示 -1没有更多
export default {
  name: 'nodata',
  props: {
    message: {
      type: String,
      default: '暂无数据'
    },
    isPic: {
      type: Boolean,
      default: true
    },
    status: {
      type: Number,
      default: 1
    },
    isWhitebg: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {}
  },
  methods: {}
}
</script>

<style>
.nodata {
  width: 100%;
  text-align: center;
  padding: 20px;
  font-size: 14px;
  color: #999;
}

.cor666 {
  color: #666;
}

.nodata .icon {
  display: block;
  width: 270px;
  height: 220px;
  margin: 0 auto 10px;
}

.noMore, .loading {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.6;
}

.noMore .noMoreicon {
  width: 86px;
  height: 74px;
  margin-right: 10px;
}

.loading .loadingIcon {
  width: 24px;
  height: 24px;
  margin-right: 10px;
}
</style>
